package com.bell.atensettings.settingDetails;

import com.bell.atensettings.R;
import com.bell.atensettings.SystemApplication;

import android.app.Activity;
import android.net.ethernet.EthernetDevInfo;
import android.net.ethernet.EthernetManager;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class WifiDetailSettings extends Activity
{
    private boolean mEnablePending;
    private EditText wifi_password;
    private Button wifi_btnConn;

    public void doClick(View view)
    {
        switch (view.getId())
        {
            case R.id.btconnect:
                getIntent().putExtra("password", wifi_password.getText().toString());
                setResult(0, getIntent());
                finish();
                break;
            case R.id.btcancel:
                finish();
                break;

            default:
                break;
        }
        overridePendingTransition(R.anim.start, R.anim.push_left_out);
    }
    
    @Override
    public void onBackPressed()
    {
        super.onBackPressed();
        overridePendingTransition(R.anim.start, R.anim.push_left_out);
    }

    @Override
    protected void onCreate(Bundle saveBundle)
    {
        super.onCreate(saveBundle);
        setContentView(R.layout.wifidetail_settings);
        
        wifi_btnConn = (Button) findViewById(R.id.btconnect);
        wifi_password = (EditText) findViewById(R.id.wifipassword);
        
        wifi_password.requestFocus();
    }

    @Override
    protected void onDestroy()
    {
        super.onDestroy();
    }

    @Override
    protected void onPause()
    {
        super.onPause();
    }

    @Override
    protected void onResume()
    {
        super.onResume();
        String password = SystemApplication.getWifiPWD(getIntent().getStringExtra("ssid"));
        wifi_password.setText(password);
    }
    
    
}
